A.
B.
C.
D.
E.
F.
G.
H.
I.
J.
K.
L.
M.
N.
O.
P.
Q.
R.
S.
T.
U.
V.
W.
X.
Y.
Z.
HTTP methods
The set of common methods for HTTP / 1.1 is defined below
Set can be expanded based on the requirements.
These method names are case sensitive
And must be used in uppercase letters.
S.N. Method and description
1 GET
The GET method is used to retrieve information from the given server
With help given a URI.
Queries with help GET should only retrieve data and
Should have no further impact on the data.
2 HEAD
Same as GET, but transfers the status line and header section only.
3 POST
A POST request is used to send data to the server for example
Customer information, file upload etc. using HTML forms.
4 PUT Replaces all current representations of the destination resource
with the uploaded content.
5 DELETE
Removes all current representations of the target resource given by a URI.
6 CONNECT
Establishes a tunnel to server identified by a given URI.
7 OPTIONS
Describes the communication options for the target resource.
8 TRACE Performs a message loop-back test along the path to the destination resource.
GET Method
A GET request retrieves data from a Web server,
By specifying parameters in the URL part of the request.
This is the most important method used for document research.
The following example uses the GET method to get hello.htm:
GET /hello.htm HTTP / 1.1
User Agent: Mozilla / 4.0 (compatible; MSIE5.01; Windows NT)
Host: www.tutorialspoint.com
Accept-language: en-us
Accept-Encoding: gzip, deflate
Connection: Keep-Alive
The server response to the above GET request will be as follows:
HTTP / 1.1 200 OK
Date: Mon, 27 Jul 2009 12:28:53 GMT
Server: Apache / 2.2.14 (Win32)
Last-Modified: Wed, 22 Jul 2009 19:15:56 GMT
ETag: & quot; 34aa387-d-1568eb00 & quot;
Vary: Authorization, Accept
Accept-Ranges: bytes
Content-Length: 88
Content-Type: text / html
Connection: Closed
Hello, World!
HEAD method
The HEAD method is functionally similar to Get,
Except that the server responds with a reply line and header,
But not entity bodies. The following example uses HEAD method,
To get header information about hello.htm:
HEAD /hello.htm HTTP / 1.1
User Agent: Mozilla / 4.0 (compatible; MSIE5.01; Windows NT)
Host: www.tutorialspoint.com
Accept-language: en-us
Accept-Encoding: gzip, deflate
Connection: Keep-Alive The server response against
the above GET request will be as follows:
HTTP / 1.1 200 OK
Date: Mon, 27 Jul 2009 12:28:53 GMT
Server: Apache / 2.2.14 (Win32)
Last-Modified: Wed, 22 Jul 2009 19:15:56 GMT
ETag: & quot; 34aa387-d-1568eb00 & quot;
Vary: Authorization, Accept
Accept-Ranges: bytes
Content-Length: 88
Content-Type: text / html
Connection: Closed
You can notice that here the server does not send any data after the header.
POST method The POST method is used when you send some data to the server,
For example file updating, form data, etc.
The following example uses the POST method to send a form data to the server,
What will be processed by a process.cgi and finally a response will be returned:
POST /cgi-bin/process.cgi HTTP / 1.1
User Agent: Mozilla / 4.0 (compatible; MSIE5.01; Windows NT)
Host: www.tutorialspoint.com
Content-Type: text / xml; Charset = utf-8
Content-Length: 88
Accept-language: en-us
Accept-Encoding: gzip, deflate
Connection: Keep-Alive
String
The server-side script process.cgi processes
Which were data and sent the following reply:
HTTP / 1.1 200 OK
Date: Mon, 27 Jul 2009 12:28:53 GMT
Server: Apache / 2.2.14 (Win32)
Last-Modified: Wed, 22 Jul 2009 19:15:56 GMT
ETag: & quot; 34aa387-d-1568eb00 & quot;
Vary: Authorization, Accept
Accept-Ranges: bytes
Content-Length: 88
Content-Type: text / html
Connection: Closed
Request Processed Successfully
PUT method
The PUT method used to prompt the server to store around the contained entity body
At a location specified by the specified URL. The following example prompts the server,
To store the given unit-boy in the hello.htm at the root of the server:
PUT /hello.htm HTTP / 1.1
User Agent: Mozilla / 4.0 (compatible; MSIE5.01; Windows NT)
Host: www.tutorialspoint.com
Accept-language: en-us
Connection: Keep-Alive
Content-type: text / html
Content-Length: 182
Hello, World!
The server will display the specified entity content at hello.
Htm file and send the following response back to the client:
HTTP / 1.1 201 Created
Date: Mon, 27 Jul 2009 12:28:53 GMT
Server: Apache / 2.2.14 (Win32)
Content-type: text / html
Content-length: 30
Connection: Closed
The file was created.
DELETE method
The DELETE method is used to request the server,
To delete a file in a location specified by the specified URL.
The following example prompts the server for the specified hello.htm file
At the root of the server:
DELETE /hello.htm HTTP / 1.1
User Agent: Mozilla / 4.0 (compatible; MSIE5.01; Windows NT)